// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

Vue.config.productionTip = false

import axios from 'axios'
Vue.prototype.axios = axios;
axios.defaults.baseURL = "http://127.0.0.1:5000/"

//拦截器
axios.interceptors.request.use(config =>{
    var token = localStorage.getItem("token")
    if (token) {
        config.headers['token'] = token
    }
    return config
})

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})